<template>
  <view class="message">
    <view class="message-head">
      <image class="touxiang" src="../../static/images/head.png">
      <text class="student">{{student}}</text>
      <text>{{stage}} 其他</text>
      <button plain class="edit" @click="edit">编辑资料</button>
    </view>
    <view class="message-footer">
      <view class="message-shang">
        <text class="message-shang-left">我的等级 lv 1</text>
        <text class="message-shang-right" @click="grade">等级定义</text>
      </view>
      <view class="message-progress">
        <text>lv1</text>
        <progress class="progress" percent></progress>
        <text>lv2</text>
      </view>
      <view class="message-juli">
        <text>0</text>
        <text>距离下一个等级还需100点成长值</text>
        <text>100</text>
      </view>
    </view>
  </view>
</template>

<style scoped>
  .message {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .message-head{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fe7200;
    color: #fff;
  }
  .touxiang{
    width: 150rpx;
    height: 150rpx;
    border-radius: 50%;
    margin-top: 80rpx;
  }
  .student {
    margin: 20rpx 0;
    font-size: 20px;
  }
  .edit {
    width: 400rpx;
    margin: 20rpx 0 80rpx 0;
    color: #fff;
    border: 1px solid #fff;
  }
  .message-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
  }
  .message-shang {
    width: 100%;
    height: 80rpx;
    line-height: 80rpx;
    display: flex;
    justify-content: space-between;
  }
  .message-shang-left{
    margin-left: 30rpx;
    font-size: 18px;
  }
  .message-shang-right {
    margin-right: 30rpx;
    color: #bbb;
  }
  .message-progress {
    width: 100%;
    display: flex;
    flex-direction: row;
    margin-left: 30rpx;
    margin-top: 30rpx;
  }
  .progress {
    width: 75%;
    margin-left:15rpx;
    margin-right: 20rpx;
  }
  .message-juli {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    margin-top: 20rpx;
  }
</style>

<script>
export default {
  data(){
    return {
      stage:this.$store.state.stage,
      student:this.$store.state.revise
    }
  },
  onShow(){
    this.stage = this.$store.state.stage
    this.student = this.$store.state.revise
  },
  methods:{
    grade(){
      uni.navigateTo({
        url:"grade"
      })
    },
    edit(){
      uni.navigateTo({
        url:"edit"
      })
    }
  }
}
</script>